import request from '@/utils/request'

// 规格管理
export function getgoodsArrtList(data: any) {
  return request({
    url: '/supplier/goods_spec/list',
    method: 'get',
    params: data,
  })
}

// 编辑规格状态
export function editgoodsArrtStatus(data: any) {
  return request({
    url: '/supplier/goods_spec/edit_status',
    method: 'post',
    data,
  })
}

export function addgoodsArrt(data: any) {
  return request({
    url: '/supplier/goods_spec/add',
    method: 'post',
    data,
  })
}

// 删除规格
export function delgoodsArrt(data: any) {
  return request({
    url: '/supplier/goods_spec/del',
    method: 'post',
    data,
  })
}
export function editgoodsArrt(data: any) {
  return request({
    url: '/supplier/goods_spec/edit',
    method: 'post',
    data,
  })
}

// 商品列表
export function getgoodsList(data: any) {
  return request({
    url: '/supplier/goods/list',
    method: 'get',
    params: data,
  })
}

// 商品上下架
export function goodsStatusOnOff(data: any) {
  return request({
    url: '/supplier/goods/status_on_off',
    method: 'post',
    data,
  })
}

// 商品详情
export function getgoodsInfo(data: any) {
  return request({
    url: '/supplier/goods/info',
    method: 'get',
    params: data,
  })
}

// 获取品牌列表
export function getBrandList() {
  return request({
    url: '/supplier/goods/brand_list',
    method: 'get',
  })
}

// 获取分类列表
export function getcateList() {
  return request({
    url: '/supplier/goods/category_list',
    method: 'get',
  })
}

export function addGoodsMenent(data: any) {
  return request({
    url: '/supplier/goods/add',
    method: 'post',
    data,
  })
}

export function editGoodsMenent(data: any) {
  return request({
    url: '/supplier/goods/edit',
    method: 'post',
    data,
  })
}

// 获取代客商品列表
export function getProxySelectGoods(data: any) {
  return request({
    url: '/supplier/goods/getGoodsSku',
    method: 'get',
    params: data,
  })
}

// 总后台来的商品列表  无法修改设置
export function getFormAdminGoodsList(data: any) {
  return request({
    url: '/supplier/goods/brand_goods_list',
    method: 'get',
    params: data,
  })
}

// 设置总后台的返点比例
export function setReturnPointRatio(data: any) {
  return request({
    url: '/supplier/goods/return_point_ratio',
    method: 'post',
    data,
  })
}
// 获取总后台的返点比例
export function getReturnPointRatio(data: any) {
  return request({
    url: '/supplier/goods/return_point_ratio',
    method: 'get',
    params: data,
  })
}

// 设置总后台的折扣
export function setDiscount(data: any) {
  return request({
    url: '/supplier/goods/set_set_discount',
    method: 'post',
    data,
  })
}
// 获取总后台的折扣
export function getFromAdminDiscount(data: any) {
  return request({
    url: '/supplier/goods/get_set_discount',
    method: 'get',
    params: data,
  })
}

// 设置总后台的通用折扣
export function setGeneralDiscount(data: any) {
  return request({
    url: '/supplier/goods/set_goods_discount',
    method: 'post',
    data,
  })
}

export function getFromAdminGeneralDiscount(data: any) {
  return request({
    url: '/supplier/goods/get_goods_discount',
    method: 'get',
    params: data,
  })
}
// 获取总后台对应的规格数据
export function getAdminArrtList(data: any) {
  return request({
    url: '/supplier/goods_spec/getGoodsSpec',
    method: 'get',
    params: data,
  })
}

// 更新品牌商品排序
export function updateBrandGoodsSort(data: any) {
  return request({
    url: '/supplier/goods/setSort',
    method: 'post',
    data,
  })
}